package megrez.bussiness.schedule.component;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import lombok.RequiredArgsConstructor;

/**
 * 项目启动完成后，加载数据库里状态为正常的定时任务
 *  
 * @author Lucky Yang
 * @since 0.0.1
 */
@Component
@RequiredArgsConstructor
public class ScheduleRunner implements CommandLineRunner  {
    private final ScheduleManagerComponent scheduleComponent;
    
    @Override
    public void run(String... args) throws Exception {
        scheduleComponent.startAll();
    }
}
